// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   SimpleTraceGenerator.java

package com.solab.iso8583.impl;

import com.solab.iso8583.TraceNumberGenerator;

public class SimpleTraceGenerator
	implements TraceNumberGenerator
{

	private int value;

	public SimpleTraceGenerator(int initialValue)
	{
		value = 0;
		if (initialValue < 1 || initialValue > 0xf423f)
		{
			throw new IllegalArgumentException("Initial value must be between 1 and 999999");
		} else
		{
			value = initialValue - 1;
			return;
		}
	}

	public int getLastTrace()
	{
		return value;
	}

	public synchronized int nextTrace()
	{
		value++;
		if (value > 0xf423f)
			value = 1;
		return value;
	}
}
